﻿@using TinyMoocSite.ViewModels
@model HomeworkFullItem

@{
    ViewBag.Title = "作业查看与修改";
    Layout = "~/Views/Teacher/CoursePageLayout.cshtml";
}

@section Homework { active }

@section RightContainer
{    
    <h4>作业管理&raquo;@Model.HomeworkTitle</h4><hr />
    @if (Model.CompletedCount == 0)
    {
        <a href="/Teacher/AddProblem?CourseId=@Model.Id&HomeworkId=@Model.HomeworkId" class="btn btn-primary">添加问题</a>
    }
    <button type="button" class="btn btn-default" onclick="history.back();">返回</button>
    <br /><br />
    
    @foreach (ProblemData item in Model.Problems)
    {
        <div class="panel panel-success">
            <div class="panel-heading">
                <h3 class="panel-title">题目编号：@item.Id</h3>
            </div>
            <div class="panel-body">
                @Html.Raw(item.Body)
                <hr />
                <p>A. @item.CandidateFirst</p>
                <p>B. @item.CandidateSecond</p>
                <p>C. @item.CandidateThird</p>
                <p>D. @item.CandidateFourth</p>
                <hr />
                <p>标准答案： @item.CorrectAnswer &nbsp; &nbsp;
                    @if (Model.CompletedCount == 0)
                    {
                        <a href="/Teacher/UpdateProblem?CourseId=@Model.Id&HomeworkId=@Model.HomeworkId&ProblemId=@item.Id">修改此问题</a>
                        <a href="/Teacher/RemoveProblem?CourseId=@Model.Id&HomeworkId=@Model.HomeworkId&ProblemId=@item.Id">删除此问题</a>
                    }
                </p>
            </div>
        </div>
    }
}

